﻿using JetBrains.ReSharper.Psi.CSharp.Tree;
using Twins.Infrastructure;
using Twins.Interface;

namespace Twins.Classes.Hanlder
{
    public class ReceiveHashLineCodeBinaryExpression
    {
        public string ReceiveHashLineCode(IBinaryExpression cSharpExpression)
        {
            string hashLineCode = "";
            var receiveHashLineCodeFromProcesserCSharpExpression = IoC
                .Resolve<IReceiveHashLineCodeFromProcesserCSharpExpression>();
            receiveHashLineCodeFromProcesserCSharpExpression
                .ReceiveHashLineCode(cSharpExpression.LeftOperand, ref hashLineCode);
            hashLineCode += cSharpExpression.OperatorSign.GetText();
            receiveHashLineCodeFromProcesserCSharpExpression
                .ReceiveHashLineCode(cSharpExpression.RightOperand, ref hashLineCode);
            return hashLineCode;
        } 
    }
}